package com.jbp.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jbp.dao.LotteryRecordDao;
import com.jbp.model.LotteryRecord;
import com.jbp.model.PrizePoolEntity;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class LotteryRecordService extends ServiceImpl<LotteryRecordDao, LotteryRecord> implements IService<LotteryRecord> {

    public LotteryRecord create(String poolType,String type, Integer poolId, Integer roomId, Integer userId) {
        LotteryRecord record = new LotteryRecord();
        record.setCreateTime(new Date());
        record.setPoolType(poolType);
        record.setType(type);
        record.setPoolId(poolId);
        record.setRoomId(roomId);
        record.setUserId(userId);
        save(record);
        return record;
    }

    public List<PrizePoolEntity> prizePoolRanks(Map<String, Object> params){
        return baseMapper.prizePoolRanks(params);
    }
}
